<style>
    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>
<!--<link rel="stylesheet" href="__STATIC__/lib/lay-module/autocomplete/autocomplete.css?v={$version}" media="all">-->
<!--<div class="layuimini-container">-->
<!--    <form id="app-form" class="layui-form layuimini-form">-->

        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label">上级分类</label>
            <div class="layui-input-block">
                <select name="parent_id" lay-search>
                    {foreach $pidMenuList as $vo}
                    <option value="{$vo.id}" {if $id==$vo.id}selected=""{/if}>{$vo.name|raw}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">分类名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" class="layui-input" lay-verify="required" lay-reqtext="请输入分类名称" placeholder="请输入分类名称" value="">
                <tip>填写菜单名称。</tip>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">分类封面</label>
            <div class="layui-input-block layuimini-upload">
                <input name="thumb" class="layui-input layui-col-xs6" lay-verify="required"  lay-reqtext="请上传分类图片" placeholder="请上传分类图片" value="">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="thumb" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_thumb" data-upload-select="thumb" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>



<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">选择图标</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="text" id="icon" name="icon" lay-filter="icon" class="hide" value="fa fa-list">-->
<!--            </div>-->
<!--        </div>-->

<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label required">target属性</label>-->
<!--            <div class="layui-input-block">-->
<!--                {foreach ['_self','_blank','_parent','_top'] as $vo}-->
<!--                <input type="radio" name="target" value="{$vo}" title="{$vo}" {if $vo=='_self'}checked=""{/if}>-->
<!--                {/foreach}-->
<!--            </div>-->
<!--        </div>-->

        <div class="layui-form-item">
            <label class="layui-form-label">分类排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" lay-reqtext="分类排序不能为空" placeholder="请输入菜单排序" value="0" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">分类描述</label>
            <div class="layui-input-block">
                <textarea name="description" class="layui-textarea" placeholder="请输入备注信息"></textarea>
            </div>
        </div>

<!--    </form>-->
<!--</div>-->
<script type="text/javascript">

require(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], function ($, ea) {

    var table = layui.table,
        treetable = layui.treetable,
        iconPickerFa = layui.iconPickerFa,
        autocomplete = layui.autocomplete;
        


  iconPickerFa.render({
                elem: '#icon',
                url: PATH_CONFIG.iconLess,
                limit: 12,
                click: function (data) {
                    $('#icon').val('fa ' + data.icon);
                },
                success: function (d) {
                    console.log(d);
                }
            });
            autocomplete.render({
                elem: $('#href')[0],
                url: ea.url('system.menu/getMenuTips'),
                template_val: '{{d.node}}',
                template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.name}}</span>',
                onselect: function (resp) {
                }
            });

            ea.listen();
    
});
</script>